package graphicinterface;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Toolkit;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class WindowNoInternetConnection 
{
	public WindowNoInternetConnection()
	{
		ImageIcon imageMascotCharacter = CreatesImageIcon.createImageIcon("images/kitsunecry.png", "mascot kitsune-chan");
		JLabel labelMascotCharacter = new JLabel(imageMascotCharacter);
		JLabel labelTitle = TextLabelCreator.createStyledTextlabel("No internet connection", 40);
		JLabel labelExplanation = TextLabelCreator.createStyledTextlabel("we're sorry, but the feature you just selected requires internet connection");
		JLabel labelExplanation2 = TextLabelCreator.createStyledTextlabel("and your computer is not connected.");
		JPanel panelExplanation = new JPanel();
		panelExplanation.setBackground(new Color(255,131,137));
		GridBagLayout layoutPanelExplanation = new GridBagLayout();
		panelExplanation.setLayout(layoutPanelExplanation);
		GridBagConstraints g = new GridBagConstraints();
		g.gridy = 0;
		g.gridheight = 2;
		panelExplanation.add(labelTitle, g);
		g.gridy = 2;
		g.gridheight = 1;
		panelExplanation.add(labelExplanation, g);
		g.gridy = 3;
		panelExplanation.add(labelExplanation2, g);
		
		JPanelWithBackgroundImage panelNoConnection = new JPanelWithBackgroundImage("backgroundbookworm.jpg");
		panelNoConnection.add(labelMascotCharacter);
		panelNoConnection.add(panelExplanation);
		
		JFrame windowNoConnection = new JFrame();
		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
		windowNoConnection.setSize(d);
		windowNoConnection.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		windowNoConnection.setAlwaysOnTop(true);
		windowNoConnection.add(panelNoConnection);
		
		windowNoConnection.setVisible(true);
		
		
		
	}

}
